import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { MstReuseStrategy } from 'mstcomponents/router';
@Component({
  selector: 'mst-demo',
  templateUrl: './demo.html',
  styleUrls: ['./demo.less'],
})
export class MstDemoComponent implements OnInit {
  two = `2:找到app.module.ts文件,在imports中引入MstRouterModule.forReuseStrategy({iframe: false })模块`;
  constructor(private router: Router) {}

  ngOnInit() {}

  open() {
    MstReuseStrategy.openRoute('https://www.baidu.com', '百度');
  }

  /**
   * 请求参数中带title就是tab标签页的标题
   */
  openSelf() {
    this.router.navigate(['/pagedemo'], { queryParams: { title: '新的页面' } });
  }
}
